package model

import (
	"time"
)

type BaseModel struct {
	ID         int32      `gorm:"primaryKey"`
	CreateTime time.Time  `gorm:"autoCreateTime"`
	UpdateTime time.Time  `gorm:"autoUpdateTime"`
	DeleteTime *time.Time `gorm:"index"`
	IsDeleted  bool
}

// User 定义用户信息
type User struct {
	BaseModel
	//gorm.Model
	Mobile   string     `gorm:"index:idx_mobile;unique;type:varchar(11);not null"`
	Password string     `gorm:"type:varchar(100);not null"`
	NickName string     `gorm:"type:varchar(20)"`
	Birthday *time.Time `gorm:"type:datetime"`
	Gender   string     `gorm:"type:varchar(6) comment 'female 女 male 男';default male;"`
	Role     int        `gorm:"column:role;default:1;type:int comment '1普通 2管理员'"`
}
